<h1><%= t :themhinhanhnuoc %></h1>

<%= form_for(@product_image) do |f| %>
  <% if @product_image.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@product_image.errors.count, "error") %> prohibited this product_image from being saved:</h2>

      <ul>
      <% @product_image.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
  	<% @product= Product.all %>
	<%= f.label :product_id, "#{t :manuoc}" %>
	<%= f.select :product_id, @product.map {|p| [ p.product_id, p.product_id ] } , { :include_blank => true } %>
  </div>

  <div class="field">
	<%= f.label :image, "#{t :hinhanhnuoc}" %>
	<%= f.text_field :image%>
  </div>
  
  
  <div class="actions">
	<%= f.submit "#{t :xacnhan}" %>
  </div>
<% end %>

<p><%= link_to "#{t :quaylai}", product_images_path %></p>
